package com.yhny.lykj.yuhannongye.app;


import android.content.res.ColorStateList;
import android.graphics.drawable.Drawable;
import android.support.v4.graphics.drawable.DrawableCompat;

import com.longsichao.lscframe.app.LSCv4Fragment;
import com.longsichao.lscframe.model.LSCModel;
import com.longsichao.lscframe.tools.LSCLog;
import com.longsichao.lscframe.view.LSCToast;
import com.yhny.lykj.yuhannongye.model.BaseModel;

/**
 * BaseFragment
 */
public class BaseFragment extends LSCv4Fragment implements Constants {

    @Override
    public boolean onModel(int caseId, LSCModel model) {
        if (model == null) {
            LSCLog.w("caseId[" + caseId + "] model is null in " + this.getClass().getName());
            if (getActivity()!=null) {
//                LSCToast.show(getActivity(), "请检查网络！");
            }
            return true;
        }
        return false;
    }
    public static Drawable tintDrawable(Drawable drawable, ColorStateList colors) {
        final Drawable wrappedDrawable = DrawableCompat.wrap(drawable);
        DrawableCompat.setTintList(wrappedDrawable, colors);
        return wrappedDrawable;
    }
    public boolean isDataEmpty(BaseModel model){
        if (model == null || model.equals("")) {
            return true;
        }
        return false;
    }
}
